<template>
  <div class="container">
    <div class="left">
      <Type-com></Type-com>
    </div>
    <div class="right">
      <div class="right_1">
        <Ha-com></Ha-com>
      </div>
     
   
    </div>
  </div>
</template>

<script>
import HaCom from "@/components/HaCom.vue";
// import TagCom from "@/components/TagCom.vue";
import TypeCom from "@/components/TypeCom.vue";

// import PageCom from "@/components/PageCom.vue";
export default {
  data() {
    return {
      tableData: "",
      //当前页
      currentInd: 1,
      //传递的参数
      pageSize: 10,
      pageNumber: null,
      pages: [],
    };
  },
  components: {
    HaCom,
    TypeCom,
    // TagCom,
    // PageCom,
  },
  methods: {
    toIncludeTag(item) {
      this.$router.push({
        path: "/home/includetag",
        query: item,
      },()=>{},()=>{});
    },
    getData() {
      this.$axios
        .post("api/index/article/list", {
          current: this.currentInd,
          size: this.pageSize,
        })
        .then((res) => {
          console.log(res);
          this.tableData = res.data;
          this.pageNumber = res.current;
          this.pages = [];
          for (let i = 0; i < res.pages; i++) {
            this.pages.push(i + 1);
          }
        });
    },
    currentIndex(val) {
      // console.log(val,'父组件val')
      this.currentInd = val;
      this.getData();
    },
  },
  created() {
    this.getData();
  },
};
</script>

<style lang="scss" scoped>
.container {
  display: flex;
  justify-content: space-around;
  .left {
    width: 960px;
    background-color: #fff;
    border-radius: 10px;
    border: #ddd 2px solid ;
    .box {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: space-between;
      .item {
        width: 444px;
        height: 300px;
        border-radius: 20px;
        border: #ddd solid 1px;
        margin-bottom: 10px;
        background-color: #fff;
        .item_img {
          img {
            width: 444px;
            height: 200px;
            vertical-align: middle;
            border-radius: 10px 10px 0px 0px;
          }
        }
        .item_content {
          padding: 10px;
          width: 100%;
          height: calc(100% - 200px);
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          text-align: left;
          box-sizing: border-box;

          border-radius: 0px 0px 10px 10px;
          span {
            background-color: rgb(182, 248, 182);
            margin-right: 5px;
            padding: 2px 5px 2px 5px;
            border-radius: 2px;
            font-size: 10px;
          }
          span:hover {
            background-color: rgb(125, 255, 125);
          }
        }
      }
    }
  }
  .right {
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .right_1 {
      padding: 10px;
      background-color: #fff;
      width: 80%;
      height: 200px;
      border: #ddd solid 1px;
      border-radius: 10px;
    }
    .right_2 {
      padding: 10px;
      background-color: #fff;
      border-radius: 10px;
      width: 80%;
      border: #ddd solid 1px;
    }
    .right_3 {
      padding: 10px;
      background-color: #fff;
      border-radius: 10px;
      width: 80%;
      border: #ddd solid 1px;
    }
  }
}
</style>